//
//  TKL_videoCell.m
//  TKL_EnPro
//
//  Created by 雅恩三河科技 on 2018/12/13.
//  Copyright © 2018年 MrZhang. All rights reserved.
//

#import "TKL_videoCell.h"

#import "Head.h"
@interface TKL_videoCell ()
@property(nonatomic,strong)UIImageView* mainIV;
@property(nonatomic,strong)UIImageView* headIV;
@property(nonatomic,strong)UILabel* nameLab;
@property(nonatomic,strong)UILabel* countLab;
@property(nonatomic,strong)UILabel* priceLab;

@end
@implementation TKL_videoCell
-(UIImageView *)mainIV
{
    if (!_mainIV) {
        _mainIV=[[UIImageView alloc] init];
        _mainIV.x=5;
        _mainIV.y=5;
        _mainIV.contentMode=UIViewContentModeScaleAspectFill;
        _mainIV.layer.masksToBounds=YES;
        _mainIV.width=self.width-10;
        _mainIV.height=self.height-WFCGFloatY(40);
        
        _mainIV.backgroundColor=HEXCOLOR(@"#f6f6f6");
    }
    return _mainIV;
}
-(UIImageView *)headIV
{
    if (!_headIV) {
        _headIV=[[UIImageView alloc] init];
        _headIV.x=0;
        _headIV.backgroundColor=[UIColor redColor];
        
        _headIV.width=WFCGFloatX(25);
        _headIV.height=_headIV.width;
        _headIV.y=self.height-_headIV.height-(WFCGFloatY(40)-_headIV.height)/2;
        [WFFunctions WFUIaddbordertoView:_headIV radius:WFCGFloatX(25)/2 width:0 color:[UIColor clearColor]];
        _headIV.backgroundColor=[UIColor greenColor];
    }
    return _headIV;
}
-(UILabel *)nameLab
{
    if (!_nameLab) {
        _nameLab=[[UILabel alloc] init];
        _nameLab.x=WFCGFloatX(5);
        _nameLab.y=self.height-WFCGFloatY(40);
        _nameLab.width=self.width-WFCGFloatX(10);
        _nameLab.height=WFCGFloatY(40);
        _nameLab.font=SYSTEMFONT(15);
        _nameLab.numberOfLines=2;
        _nameLab.textColor=HEXCOLOR(@"#333333");
        _nameLab.text=@"哈哈哈哈哈哈哈";
        
    }
    return _nameLab;
}
-(UILabel *)priceLab
{
    if (!_priceLab) {
        _priceLab=[[UILabel alloc] init];
        _priceLab.x=WFCGFloatX(9);
        _priceLab.y=self.height-WFCGFloatY(26);
        _priceLab.width=self.width-WFCGFloatX(10);
        _priceLab.height=WFCGFloatY(15);
        _priceLab.font=SYSTEMFONT(15);
        _priceLab.textColor=HEXCOLOR(@"#c3a871");
        _priceLab.text=@"我爱你";
    }
    return _priceLab;
}
-(UILabel *)countLab
{
    if (!_countLab) {
        _countLab=[[UILabel alloc] init];
        _countLab.x=self.width-WFCGFloatX(60);
        _countLab.y=self.height-WFCGFloatY(26);
        _countLab.width=WFCGFloatX(60);
        _countLab.height=WFCGFloatY(12);
        _countLab.font=SYSTEMFONT(10);
        _countLab.textColor=HEXCOLOR(@"#cccccc");
        _countLab.text=@"我安抚";
    }
    return _countLab;
}
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self addSubview:self.mainIV];
        [self addSubview:self.nameLab];
       // [self addSubview:self.priceLab];

    }
    return self;
}

-(void)setSourceDic:(NSMutableDictionary *)sourceDic
{
    
   //[_mainIV sd_setImageWithURL:[NSURL URLWithString:[sourceDic objectForKey:@"cover"]] placeholderImage:DefaultImage];
    _mainIV.image=[UIImage imageNamed:[NSString stringWithFormat:@"%@.jpg",[sourceDic objectForKey:@"cover"]]];
    _nameLab.text=[sourceDic objectForKey:@"title"];
    //_priceLab.text=[[sourceDic objectForKey:@"createTime"] substringToIndex:10];
}
@end
